/* 
 * File:   main.cpp
 * Author: Yujie Hao
 *
 * Created on February 23, 2013, 5:34 PM
 */

#include <cstdlib>
#include <iostream>

using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {
    cout << static_cast<float>(1/2) << endl;
    float totalAmount;
    cout << "Please input the total amount of money: ";
    cin >> totalAmount;
    
    int dollars = static_cast<int>(totalAmount);
    if ( dollars > 1 ) {
        cout << "It is\n" << dollars << " dollars," << endl;
    }
    else {
        cout << "It is\n" << dollars << " dollar," << endl;
    }     
    int remainingCents = static_cast<int>(( totalAmount - dollars ) * 100);
    
    int quarters = remainingCents / 25;
    if ( quarters > 1) {
        cout << quarters << " quarters," << endl;
    }
    else {
        cout << quarters << " quarter," << endl;
    }        
    //remainingCents -= quarters * 25;
    remainingCents %= 25;
    
    int dimes = remainingCents / 10;
    if ( dimes > 1) {
        cout << dimes << " dimes," << endl;
    }
    else {
        cout << dimes << " dime," << endl;
    }
    remainingCents %= 10;
    
    int nickels = remainingCents / 5;
    if ( nickels > 1) {
        cout << nickels << " nickels" << endl;
    }
    else {
        cout << nickels << " nickel," << endl;
    }    
    remainingCents %= 5;
    
    int cents = remainingCents;
    if ( cents > 1) {
        cout << cents << " cents" << endl;
    }
    else {
        cout << cents << " cent," << endl;
    }
        
    return 0;
}
